package com.huluobo.a2303mdmdemo.pages

import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.padding
import androidx.compose.material3.Button
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.unit.dp
import androidx.compose.ui.viewinterop.AndroidView
import androidx.navigation.NavHostController
import com.amap.api.maps.AMap
import com.amap.api.maps.MapView
import com.huluobo.lib_base.BaseTitle

/**
 *  Created by LC on 2025/9/5.
 */
lateinit var map: AMap
lateinit var mapView: MapView

@Composable
fun MapPage(navHostController: NavHostController) {
    Column(Modifier.padding(10.dp)) {
        BaseTitle(title = "位置信息", navHostController = navHostController)
        AndroidView(factory = {
            mapView = MapView(it)
            mapView.onCreate(null)
            mapView
        }, Modifier.weight(1f))
        Spacer(modifier = Modifier.height(10.dp))
        Button(onClick = {
                         navHostController.popBackStack()
        }, modifier = Modifier.fillMaxWidth()) {
            Text(text = "发送位置")
        }
    }
}